import java.util.Scanner;

//写一个函数返回参数二进制中1的个数
public class Binary_1_Amount {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int count = 0;
        while (n!=0) {
            count++;
            n = n&(n-1);
        }
        System.out.println(count);
    }
}
